<template>
	<view class="mask-select" v-if="show" @tap="hide">
		<view class="mask-container">
			<view class="mask-header" v-if="title.length>0">{{title}}</view>
			<view class="mask-content">
				<slot></slot>
			</view>
			<view class="mask-cancel" @tap="hide">取消</view>
		</view>
		
	</view>
</template>

<script>
	export default {
		props: {
			show: {
				type: Boolean,
				default: false
			},
			title: {
				type: String,
				default: ""
			}
		},
		data() {
			return {
				
			};
		},
		methods: {
			hide: function() {
				this.$emit('hidePopup');
			}
		}
	}
</script>

<style>
	.mask-select{
		position: fixed;
		z-index: 998;
		top: 0;
		right: 0;
		bottom: 0;
		left: 0;
		background-color: rgba(0, 0, 0, .3);
		font-size: 28upx;
	}
	
	.mask-select .mask-container{
		position: absolute;
		bottom: 0;
		background: #fff;
		width: 100%;
	}
	
	.mask-select .mask-header{
		height: 80upx;
		display: flex;
		justify-content: center;
		align-items: center;
		border-bottom: 1upx solid #eee;
	}
	
	.mask-select .mask-cancel{
		height: 80upx;
		display: flex;
		justify-content: center;
		align-items: center;
		background: #E60012;
		color: #fff;
	}
	
	.mask-select .mask-content{
		max-height: 500upx;
		overflow: scroll;
	}
</style>
